From 872149a29cefdb129f93342a23a5425c2767b2f9 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 2 Aug 2005 19:04:13 +0000 Subject: [PATCH] Add prototype for balloon_init_watcher. Also cleanup balloon_init_watcher whitespace. Signed-off-by: Christian Limpach --- .../drivers/xen/balloon/balloon.c | 24 +++++-------------- .../drivers/xen/xenbus/xenbus_probe.c | 1 + .../include/asm-xen/balloon.h | 3 +++ 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index 2b4b7e992f..ba1e38a770 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -84,9 +84,6 @@ static struct timer_list balloon_timer; /* Flag for dom0 xenstore workaround */ static int balloon_xenbus_init=0; -/* Init Function */ -void balloon_init_watcher(void); - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) /* Use the private and mapping fields of struct page as a list. */ #define PAGE_TO_LIST(p) ( (struct list_head *)&p->private ) @@ -354,27 +351,21 @@ static void watch_target(struct xenbus_watch *watch, const char *node) } -/* - Try to set up our watcher, if not already set - -*/ -void balloon_init_watcher(void) +/* Init Function - Try to set up our watcher, if not already set. */ +void balloon_init_watcher(void) { int err; - if(!xen_start_info.store_evtchn) - { + if (!xen_start_info.store_evtchn) { IPRINTK("Delaying watcher init until xenstore is available\n"); return; } down(&xenbus_lock); - if(! balloon_xenbus_init) - { + if (!balloon_xenbus_init) { err = register_xenbus_watch(&xb_watch); - if(err) - { + if (err) { /* BIG FAT FIXME: dom0 sequencing workaround * dom0 can't set a watch on memory/target until * after the tools create it. So, we have to watch @@ -384,16 +375,13 @@ void balloon_init_watcher(void) * non-existant keys */ register_xenbus_watch(&root_watch); - } - else - { + } else { IPRINTK("Balloon xenbus watcher initialized\n"); balloon_xenbus_init = 1; } } up(&xenbus_lock); - } EXPORT_SYMBOL(balloon_init_watcher); diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index 2787ee8174..d440618f2d 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/include/asm-xen/balloon.h b/linux-2.6-xen-sparse/include/asm-xen/balloon.h index 80ef4acefc..413919b322 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/balloon.h +++ b/linux-2.6-xen-sparse/include/asm-xen/balloon.h @@ -48,4 +48,7 @@ extern spinlock_t balloon_lock; #define balloon_lock(__flags) spin_lock_irqsave(&balloon_lock, __flags) #define balloon_unlock(__flags) spin_unlock_irqrestore(&balloon_lock, __flags) +/* Init Function - Try to set up our watcher, if not already set. */ +void balloon_init_watcher(void); + #endif /* __ASM_BALLOON_H__ */ -- 2.30.2